package start.spring.basic.exinterface;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;

import start.spring.basic.util.common.LoggerFilePort;

@SpringBootApplication
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class,
		DruidDataSourceAutoConfigure.class,
		RedisAutoConfiguration.class,
		RedisRepositoriesAutoConfiguration.class})
@ComponentScan(basePackages={"start.spring.basic"})
@MapperScan(basePackages={"start.spring.basic.dao","start.spring.basic.exinterface.dao"})
@EnableFeignClients(basePackages = {"start.spring.basic"})
@EnableDiscoveryClient
public class ExInterfaceApplication {

	@Bean
	@LoadBalanced
	RestTemplate restTemplate() {
		return new RestTemplate();
	}
	
	public static void main(String[] args) {
		LoggerFilePort.getCommandPort(args);
		SpringApplication.run(ExInterfaceApplication.class, args);
	}
}
